import { instance } from "../utils/request";
const getGoodsPagination = async (params) => {
  return await instance.get("/Goods/Pagination", params);
};

const addGoods = async (data) => {
  return await instance.upload("/Goods/Add", data);
};

const updateGoods = async (data) => {
  return await instance.upload("/Goods/Update", data);
};

const getGoodsDetail = async (id) => {
  return await instance.get("/Goods/Detail", { id: id });
};

const deleteGoods = async (id) => {
  return await instance.post("/Goods/Delete", { id: id });
};

const goodsApi = {
  getGoodsPagination,
  addGoods,
  updateGoods,
  getGoodsDetail,
  deleteGoods,
};

export default goodsApi;
